export default {
	methods: {
		getRef(componentName) {
			if (!this.$noNull(componentName)) return this.$logs("组件名称未传入", 2);
			if (this.$refs && this.$refs[componentName]) {
				return this.$refs[componentName]
			}
			let component = this.$parent
			if (!component) {
				return null
			}
			for (let i = 1; i <= 9; i++) {
				if (component.$refs && component.$refs[componentName]) {
					return component.$refs[componentName]
				}
				try {
					component = component.$parent
				} catch (ex) {
					component = null
				}
				if (!component) {
					return null
				}
			}
			return null
		}
	}

}
